<template>
  <div class="head_container">
    <div>
      <img src="@/assets/heima.png" alt="">
      <span>VUE后台管理系统</span>
    </div>
    <el-button type="info" @click="logout">退出</el-button>
  </div>
</template>

<script>
export default {
  name: 'Head',
  methods: {
    // 退出时清空token值，返回到login界面
    logout() {
      sessionStorage.removeItem('token')
      sessionStorage.removeItem('activePath')
      this.$router.replace('/Login')
    }
  }
}
</script>

<style lang="less" scoped>
.head_container {
  display: flex;
  justify-content: space-between;
  color: #fff;
  font-size: 20px;
  align-items: center;
  > div {
    display: flex;
    align-items: center;
  }
  > span {
    margin-left: 15px;
  }
}
</style>